package com.gxtbindings.bindings.client.util;


/**
 * An event which contains information about changes to an EventList.
 * 
 * @author Jonathan Janisch
 *
 */
public class ListChangeEvent<E> {

	public enum ListChangeType { INSERT, UPDATE, DELETE };
	
	private final ListChangeType type;
	
	private final int startIndex;
	
	private final int endIndex;
	
	private final EventList<E> sourceList;

	public ListChangeEvent(ListChangeType type, int startIndex, int endIndex,
			EventList<E> sourceList) {
		super();
		this.type = type;
		this.startIndex = startIndex;
		this.endIndex = endIndex;
		this.sourceList = sourceList;
	}

	public ListChangeType getType() {
		return type;
	}

	public int getStartIndex() {
		return startIndex;
	}

	public int getEndIndex() {
		return endIndex;
	}

	public EventList<E> getSourceList() {
		return sourceList;
	}
}
